import request from "@/utils/request";

export default {
    //查询用户  conditions 查询条件
    searchman(conditions) {
        return request({
            method: "get",
            url: "/user/getUser",
            params:{
                conditions
            }
        })
    },
    // 分页查询用户,
    // page当前页码, size 每页显示条数, 
    // 后台要通过 page 和 size 统计本次请求响应的数据
    search(page, size) {
        return request({
            url: `user/padinguser`,
            method: "get",
            params: {
                page,
                size
            }
        })
    },
    //增加新用户
    addMember(pojo) {
        return request({
            url: `/user/addUser`,
            method: "post",
            data: pojo
        })
    },
    //更新用户信息
    updataMember(userid,pojo){
        return request({
            url:`/user/editUser/`+userid,
            method:"put",
            data:pojo
        })
    },
    //删除用户
    deleteMember(username){
        return request({
            url:`/user/delUser`,
            method:'delete',
            data:{
                username
            }
        })
    }
}